#!/usr/bin/env ruby

module RedBook
	TEST_HOME = File.dirname(File.expand_path(__FILE__))+'/..' unless const_defined?(:TEST_HOME)
end

require "#{RedBook::TEST_HOME}/lib/redbook"

describe RedBook::TimeCalc do
  
	before :each do
    @time = Time.now
		@tc1 = RedBook::TimeCalc.new 100 # 1 minute and 40 seconds
		@tc2 = RedBook::TimeCalc.new @time, @time+3600*24*365*10+3600*2+1 # Ten years, 2 hours and 1 second
	end  
  
  it "should display time in readable form" do
    @tc1.to_s.should == "1 minute and 40 seconds."
    @tc2.to_s.should == "10 years, 2 hours and 1 second."
  end
  
end


